package com.szpt.mo.bhubackground.entity;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.szpt.mo.bhubackground.service.ITbUserService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * <p>
 *
 * </p>
 *
 * @author mo
 * @since 2022-06-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("tb_post")
@ApiModel(value = "TbPost对象", description = "")
public class TbPost implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "介绍")
    private String recommend;

    @ApiModelProperty(value = "问题id")
    private Long questionId;

    @ApiModelProperty(value = "发帖用户id")
    private Long userId;

    @ApiModelProperty(value = "封面图片")
    private String faceImage;

    @ApiModelProperty(value = "同意")
    private Long agreement;

    @ApiModelProperty(value = "踩")
    private Long disagree;

    @ApiModelProperty(value = "帖内容（网址markdown）")
    private String content;

    @ApiModelProperty(value = "创建日期")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新日期")
    private LocalDateTime updateTime;

    @TableField(exist = false)
//    @JsonIgnore
    private TbUser user;

}
